package com.liyu.service;

import com.liyu.mapper.UserMapper;
import com.liyu.pojo.User;
import com.liyu.util.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

/**
 * [һ�仰��������Ĺ���]
 *
 * @author : [Administrator]
 * @version : [v1.0]
 * @createTime : [2022/10/31 14:31]
 */
public class UserService {
    SqlSessionFactory factory = SqlSessionFactoryUtils.getSqlSessionFactory();

    public User login(String id, String password) {
        SqlSession sqlSession = factory.openSession();
        UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
        User userInfo = userMapper.select(id, password);
        System.out.println("user");
        return userInfo;
    }
}
